﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace GameHungTrung.Entities
{
    class Egg : MySprite2D
    {
        #region MY CODE
        public enum Type { Trung, ChatThai };

        private Type _Type;

        private int _iSpeed;
        private bool _isMoving;

        public bool IsMoving
        {
            get { return _isMoving; }
            set { _isMoving = value; }
        }

        public Egg(Texture2D texture, int left, int top, int width, int height)
        {
            _textureSprite = texture;
            _iLeft = left;
            _iTop = top;
            _iWidth = width;
            _iHeight = height;
            _iSpeed = GameManager.iSpeedEgg;
            _isMoving = false;
            _Type = Type.Trung;
        }

        public void GetType(Type type)
        {
            _Type = type;
            switch (_Type)
            {
                case Type.Trung:
                    _textureSprite = GameManager.textureEgg;
                    _iWidth = _textureSprite.Width;
                    _iHeight = _textureSprite.Height;
                    break;
                case Type.ChatThai:
                    _textureSprite = GameManager.textureShit;
                    _iWidth = _textureSprite.Width;
                    _iHeight = _textureSprite.Height;
                    break;
                default:
                    break;
            }
        }

        public void Move()
        {
            if (_iTop + _iHeight < Game1._iHeightWindow)
            {
                _iTop += _iSpeed;
            }
        }

        public int SPEED
        {
            get { return _iSpeed; }
            set { _iSpeed = value; }
        }
        public Type TYPE
        {
            get { return _Type; }
            set { _Type = value; }
        }
        #endregion
    }
}
